1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer product.
2. Description of the Related Art
In recent years, digital cameras are widely used and digital camera function is installed on a mobile phone terminal as default. Photographs taken by the digital cameras or the digital camera function are normally saved as image data, which does not fade like a photograph printed on a sheet, and can be easily improved by image processing.
One of basic technologies in the field of image processing is contour extraction. The process of contour extraction is necessary to convert an image taken by a digital camera into a hand-drawn image, or to automatically set a range to which effects, such as gradation of color, are added in the image taken by the digital camera. Generally, as described in “Practical image processing in C language” written by Seiki Inoue, Nobuyuki Yagi, Masaki Hayashi, Eisuke Nakasu, and Kouji Mitani, pp 38-50, 1999, published by Ohmsha Ltd., the contour extraction is realized by comparing intensity of each of pixels with intensity of pixels adjacent to the pixel in the image data.
In a conventional contour extraction method, in which intensity of a pixel is compared with that of adjacent pixels, a range of extracted contour is broader than a range of contour that is supposed to be extracted.
When pixels with high intensity and pixels with low intensity are adjacent to each other, it is preferable that the pixels with low intensity alone are extracted as a contour. However, due to difference in intensity among the pixels in a given area, the pixels with high intensity are also extracted as the contour, which makes the contour wider than the one that is supposed to be extracted.